/// <reference path="../_all.ts" />

module Application.Services {

    export class ServiceUtility {
        public static GetServiceURL(resourceURL: string): string {
            var serviceURL = Application.Constants.Services.ApiRemoteUrl;
            if (resourceURL.substring(0, 1) == "/") {
                resourceURL = resourceURL.substring(1);
            };
            if (serviceURL.substring(serviceURL.length - 1, 1) != "/") {
                serviceURL += '/';
            };
            return serviceURL + resourceURL;
        }

        public static GetLangURL(resourceURL: string): string {
            var serviceURL = Application.Constants.Services.LanguageRemoteUrl;
            if (resourceURL.substring(0, 1) == "/") {
                resourceURL = resourceURL.substring(1);
            };
            if (serviceURL.substring(serviceURL.length - 1, 1) != "/") {
                serviceURL += '/';
            };
            return serviceURL + resourceURL;
        }
    }

}
